<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<title>Insert title here</title>
	<tr>
		<td>
		<table border="1" style="min-height:266px;">
		<tr>
			<td colspan = "2" bgcolor="#C0C0C0" style="height:18px;">
			<div style="float:left;">New post</div><div style="float:right;">#${PostNr}</div><a id="link${PostNr }"></a>
			</td>
		</tr>
			<tr>
				<td width="150px" bgcolor="#E0E0E0" align = "left" valign="top">
					<nobr>${sessionScope.user.name }</nobr><br>
					<small>${lvls[sessionScope.user.userlvl]}<br>
					joined: ${sessionScope.user.joined}<br>
					posts: ${sessionScope.user.numberOfPosts}
					</small>
				</td>
				<td width="450px" align="left" valign="top" height="266px">
					<form ACTION="ForumController" METHOD="POST" >
						<textarea id="content" name="content" 
						style="position:inherit;height:263px;width:445px;overflow:auto;font-family:Times New Roman;font-size:100%;"><c:if test="${not empty param.edit}">${post.editContent }</c:if></textarea>
						
						<input type="hidden" name="threadID" value="${param.threadID }" READONLY>
						<input type="hidden" name="subForumID" value="${param.subForumID }" READONLY>
						<input type="hidden" name="postNR" value ="${PostNr }" READONLY>
						<c:choose>
							<c:when test="${PostNr ne param.edit}">
								<input type="hidden" name="action" value="makePost" READONLY>
								<br><input type="submit" value="Post!" style="position:inherit;width:450px"/>
							</c:when>
							<c:otherwise>
								<input type="hidden" name="action" value="editPost" READONLY>
								<input type="hidden" name="postID" value="${post.postID }" READONLY>
								<br><input type="submit" value="Edit!" style="position:inherit;width:450px"/>
							</c:otherwise>
						</c:choose>
					</form>
				</td>
			</tr>
		</table>
		</td>
	</tr>
</head>
<body>

</body>
</html>